<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ims.tld" prefix="IMS"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<IMS:codeFormatter dictKeys="param_type" formatFields="paramType"/>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>键值参数</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet"
	href="${ctx}/static/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="${ctx}/static/layuiadmin/style/admin.css"
	media="all">
</head>
<body>
	<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">参数名称</label>
            <div class="layui-input-block">
              <input type="text" name="paramName" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">参数键</label>
            <div class="layui-input-block">
              <input type="text" name="paramKey" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
              <select name="paramType">
               <IMS:codeStore dictKey="param_type"/>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <button  class="layui-btn layuiadmin-btn-sm"  lay-submit lay-filter=" "  >
                                         查询
            </button>
            <button type="reset" class="layui-btn layuiadmin-btn-sm" >
                                    重置
            </button>
          </div>
        </div>
      </div>
      
      <div class="layui-card-body">
        <table id="paramList" lay-filter="LAY-user-manage"></table>
        <script type="text/html" id="imgTpl"> 
          <img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
        </script> 
        <script type="text/html" id="table-useradmin-webuser">
          <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
          <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
        </script>
      </div>
    </div>
  </div>

	<script src="${ctx}/static/layuiadmin/layui/layui.js"></script>
	<script>
		layui.config({
			base : '${ctx}/static/layuiadmin/' //静态资源所在路径
		}).extend({
			index : 'lib/index' //主入口模块
		}).use([ 'index', 'table','common' ], function() {
			 var $ = layui.$
			 ,form = layui.form
			 ,table = layui.table;
			//监听搜索
			 form.on('submit(submit-search)', function(data){
			      var params = data.field;
			      //执行重载
			      table.reload('paramList', {
			        where: params
			      });
			  });
			  
			table.render({
				elem : '#paramList',
				url : '${ctx}/system/param/list',
				height : 'full-65',
				cellMinWidth : 80,
				page : true,
				limit : 20,
				limits : [ 10, 20, 50, 100, 200 ],
				cols : [ [ {
					type : 'numbers',
					title : '序号'
				}, {
					type : 'checkbox'
				}, {
					field : 'paramId',
					title : '编号',
					hide : true
				}, {
					field : 'paramName',
					title : '参数名称',
					minWidth : 140
				}, {
					field : 'paramKey',
					title : '参数键',
					minWidth : 140
				}, {
					field : 'paramValue',
					title : '参数值',
					minWidth : 150
				}, {
					field : 'paramRemark',
					title : '备注',
					minWidth : 150,
				}, {
					field : 'paramType',
					title : '参数分类',
					minWidth : 100,
					templet:param_typeFormatter,
				} ] ]
			});

		});
		
	</script>
	
</body>
</html>